package l.l.w.网易2018实习.数对;

import java.util.Scanner;

/**
 * Created by llw on 2018/3/28/0028.
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        long result = 0;
        long t = n - k + 1;
        result += (t-1)*t/2;
        for(int i = n; i >= k+1; --i){
            result += ((n - i) / i)*(i - k);
            int mod = (n - i) % i - k;
            if(mod >= 0)
                result += mod + 1;
        }
        if(k == 0)
            result -= n;
        System.out.println(result);
    }
}
